package com.helpers;

import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;


public class SystemProperties {
	
	private static volatile SystemProperties instance = null;
	private Properties props=new Properties();

	private SystemProperties(){}

	public static SystemProperties getInstance() {
		if (instance == null) {
			synchronized (SystemProperties.class) {
				// Double check
				if (instance == null) {
					instance = new SystemProperties();
				}		
			}
		}
		return instance;
	}

	
	public void loadProperties(InputStream is) {
		try {
			props.load(is);
		} catch (IOException e) {
			e.printStackTrace();
		} finally {
			try {
				is.close();
			} catch (IOException e) {
				e.printStackTrace();
			}
		}
	}
	
	public Properties getProperties(){
		return this.props;
	}
	

}
